﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using PBOffice.Models;
using PBOffice.BLL;

public partial class AppraisalManager_Leave : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        OffWork off = new OffWork();
        off.BeginDate =Convert.ToDateTime(this.txtBeginTime.Text);
        off.EndDate = Convert.ToDateTime(this.txtEndTime.Text);
        off.Hours = Convert.ToInt32(this.txtTime.Text);
        off.Memo = this.txtMemo.Text;
        off.StfCode = ((Staff)Session["username"]).StfCode;
        AuditType au=new AuditType();
        au.StatusId=1;
        au.AuditStatus="同意";
        off.Status =au;
        LeaveType type=new LeaveType();
        type.TypeId=Convert.ToInt32(this.ddlType.SelectedItem.Value);
        type.TypeName=this.ddlType.Text;
        off.Type = type;
        new OffWorkManager().AddOffWork(off);
    }
}